package com.goodving.guli.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageButton;
import android.widget.TextView;

import com.goodving.guli.R;
import com.goodving.guli.bt.C0668a;
import com.goodving.guli.bt.utils.WeightUtil;
import com.goodving.guli.bt.weight.BabyWeightUtil;
import com.goodving.guli.view.WeightTableView;

/**
 * Created by john on 2015/12/9.
 */
public class BabyWeightInfoActivity extends SystemBarTintActivity {
    int f11097a;
    int f11098b;
    private ImageButton f11099c;
    private Context f11100d;
    private WeightTableView f11101e;
    private TextView f11102f;

    public BabyWeightInfoActivity() {
        this.f11100d = this;
        this.f11097a = 1;
        this.f11098b = 0;
    }

    class C2038j implements View.OnClickListener {
        final /* synthetic */ BabyWeightInfoActivity f11520a;

        C2038j(BabyWeightInfoActivity babyWeightInfoActivity) {
            this.f11520a = babyWeightInfoActivity;
        }

        public void onClick(View view) {
            C0668a.m8126a(this.f11520a.f11100d, C0668a.hs);
            this.f11520a.startActivity(new Intent(this.f11520a.f11100d, BabyTipsDetailActivity.class));
        }
    }

    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView((int) R.layout.activity_baby_weight_info);
        this.f11099c = (ImageButton) findViewById(R.id.go2_txt_detail_btn);
        this.f11099c.setOnClickListener(new C2038j(this));
        this.f11101e = (WeightTableView) findViewById(R.id.weight_table_view);
        this.f11102f = (TextView) findViewById(R.id.baby_weight_info_titl);
        if (getIntent() != null) {
            this.f11097a = getIntent().getIntExtra("GENDER", 1);
            this.f11098b = getIntent().getIntExtra("UNIT", 0);
        }
        if (this.f11097a == 1) {
            this.f11102f.setText(getString(R.string.baby_boy_weight_model_new, new Object[]{WeightUtil.m15698a(this.f11100d, this.f11098b)}));
            this.f11101e.m14249a(BabyWeightUtil.m15905a().m15906a(this.f11098b, this.f11097a));
            return;
        }
        this.f11102f.setText(getString(R.string.baby_girl_weight_model_new, new Object[]{WeightUtil.m15698a(this.f11100d, this.f11098b)}));
        this.f11101e.m14249a(BabyWeightUtil.m15905a().m15906a(this.f11098b, this.f11097a));
    }
}
